const calculateTimeDifference = (date1, date2) => {
    return Math.abs(new Date(date1) - new Date(date2));
};

const getHoursDifference = (date1, date2) => {
    return calculateTimeDifference(date1, date2) / (1000 * 60 * 60);
};

const formatDate = (date) => {
    return new Date(date).toISOString();
};

const isExpired = (date) => {
    return new Date(date) < new Date();
};

module.exports = {
    calculateTimeDifference,
    getHoursDifference,
    formatDate,
    isExpired
};